Skip to content

Bug fix: Remove fallback from LCSC barcode part resolver#1302

Open
swdee wants to merge 3 commits intoPart-DB:masterfrom
swdee:mpn-fallback-fix
Open

Bug fix: Remove fallback from LCSC barcode part resolver#1302
swdee wants to merge 3 commits intoPart-DB:masterfrom
swdee:mpn-fallback-fix

Conversation

@swdee
Copy link
Contributor

@swdee swdee commented Mar 8, 2026

As discussed in #1297 this PR removes the fallback logic from the part resolver of LCSC codes. This resolves the issue where a similarly named manufacture part but with different LCSC code pc number was being matched when it should not have been.

@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.32%. Comparing base (343c078) to head (e11c73a).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1302   +/-   ##
=========================================
  Coverage     56.31%   56.32%           
+ Complexity     8320     8319    -1     
=========================================
  Files           611      611           
  Lines         26726    26724    -2     
=========================================
+ Hits          15050    15051    +1     
+ Misses        11676    11673    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@MayNiklas MayNiklas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solves the issue for me 👍

@jbtronics
Copy link
Member

I think it is useful to have a fallback using PartRepository::getPartBySPN with the lcsc part number.
That way the resolving is also useable if the part was not added via the LCSC provider

@swdee
Copy link
Contributor Author

swdee commented Mar 11, 2026

I think it is useful to have a fallback using PartRepository::getPartBySPN with the lcsc part number. That way the resolving is also useable if the part was not added via the LCSC provider

This has been added in.

@jbtronics
Copy link
Member

The SPN resolval logic should also be part of the LCSC submethod (or we inline the complete method).

And I think most people will have the LCSC product code as SPN (as that is the order number) not with the MPN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants